with Ada.Text_IO; use Ada.Text_IO;
with Ada.Real_Time;

package body Logging is

   Start_T : Ada.Real_Time.Time;
   End_T : Ada.Real_Time.Time;
   Total_T : Duration;
   Counter : Natural := 0;

   procedure Info(S : String) is
   begin
      pragma Debug(Put_Line("INFO: " & S));
      null;
   end Info;

   procedure Warning(S : String) is
   begin
      pragma Debug(Put_Line("WARNING: " & S));
      null;
   end Warning;

   procedure Error(S : String) is
   begin
      pragma Debug(Put_Line("ERROR: " & S));
      null;
   end Error;

   procedure Start_Timer_Debug is
   begin
      Start_T := Ada.Real_Time.Clock;
      Info("Starting timer");
   end Start_Timer_Debug;

   procedure Start_Timer is
   begin
      pragma Debug(Start_Timer_Debug);
      null;
   end Start_Timer;

   procedure Stop_Timer_Debug is
      use Ada.Real_Time;
   begin
      End_T := Ada.Real_Time.Clock;
      Total_T := Ada.Real_Time.To_Duration (End_T - Start_T);
      Info("Done - in :" & Duration'Image(Total_T) & " sec");
   end Stop_Timer_Debug;

   procedure Stop_Timer is
   use Ada.Real_Time;
   begin
      pragma Debug(Stop_Timer_Debug);
      null;
   end Stop_Timer;

   procedure Start_Counter_Debug is
   begin
      Counter := 0;
   end Start_Counter_Debug;

   procedure Start_Counter is
   begin
      pragma Debug(Start_Counter_Debug);
      null;
   end Start_Counter;

   procedure Increment_Counter_Debug(I : in Integer := 1) is
   begin
      Counter := Counter + I;
   end Increment_Counter_Debug;

   procedure Increment_Counter(I : in Integer := 1) is
   begin
      pragma Debug(Increment_Counter_Debug(I));
      null;
   end Increment_Counter;

   procedure Stop_Counter_Debug is
   begin
      Info("Counter was: " & Natural'Image( Counter));
      Counter := 0;
   end Stop_Counter_Debug;

   procedure Stop_Counter is
   begin
      pragma Debug(Stop_Counter_Debug);
      null;
   end Stop_Counter;

end Logging;